﻿
using System.Diagnostics;
namespace EasyComm.Utilities
{
    public class PerformanceUtils
    {
        public static double GetCPUPercent()
        {
            //Process proc = Process.GetCurrentProcess();

            //proc.

            string appName = Process.GetCurrentProcess().ProcessName;
            using (PerformanceCounter myAppCpu = new PerformanceCounter("Process", "% Processor Time", appName, true))
            {
                return myAppCpu.NextValue();
            }
        }
    }
}
